<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "version".
 *
 * @property integer $version_id
 * @property string $version_num
 * @property string $terminal_type
 * @property string $app_type
 * @property string $download_url
 * @property string $update_content
 * @property string $update_way
 * @property integer $create_time
 */
class Version extends \yii\db\ActiveRecord
{

    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'version';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['version_num', 'app_type', 'download_url', 'update_content'], 'required'],
            [['terminal_type', 'app_type', 'update_content', 'update_way'], 'string'],
            ['create_time', 'default', 'value' => $_SERVER['REQUEST_TIME']],
            [['version_num'], 'string', 'max' => 100],
            [['download_url'], 'string', 'max' => 255],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'version_id' => 'Version ID',
            'version_num' => '版本号',
            'terminal_type' => '终端类型：1会员，2:代理',
            'app_type' => 'APP类型',
            'download_url' => '下载地址',
            'update_content' => '更新内容',
            'update_way' => '更新方式：autonomous自主，forced强制',
            'create_time' => '创建时间',
        ];
    }
}
